$(function (){
	try{
		LoadFieldInfo("no");
	}catch (e){}
	try{
		LoadProTypeInfo("no");
	}catch (e){}
	try{
		CheckPriceMode();
	}catch (e){}

	WindowHeight(0);setTimeout("WindowHeight(-1)",500);
});


// 检测表单
function CheckForm(){
	if ($id('theme').value == ""){alert("标题不能为空");$id('theme').focus();return false}
	if ($id('typeStr').value == ""){alert("请选择类别");$id('typeStr').focus();return false}
	if ($id('groupID').value == ""){alert("请选择组");$id('groupID').focus();return false}
	/* if (! $id('priceMode2').checked){
		if ($id('goUrl').value == ""){alert("开通购买网址不能为空");$id('goUrl').focus();return false}
	} */
	return true;
}



// 检测价格模式
function CheckPriceMode(){
	if ($id('priceMode0').checked){
		$id('priceMode0Box').style.display = "";
	}else{
		$id('priceMode0Box').style.display = "none";
	}
	
	if ($id('priceMode1').checked){
		$id('priceMode1Box').style.display = "";
	}else{
		$id('priceMode1Box').style.display = "none";
	}
	
	if ($id('priceMode2').checked){
		$id('priceMode2Box').style.display = "";
		$id('goUrlBox').style.display = "none";
	}else{
		$id('priceMode2Box').style.display = "none";
		$id('goUrlBox').style.display = "";
	}
}


// 读取字段信息
function LoadFieldInfo(str){
	if ($id("typeStr").value==""){
		if (str != "no"){ alert("请选择 类别");return false; }
	}else{
		AjaxGetDeal("idcProData_deal.php?mudi=loadFieldInfo&typeStr="+ $id("typeStr").value +"&groupID="+ $id("currGroupID").value);
	}
}


// 读取产品类型信息
function LoadProTypeInfo(str){
	if ($id("proType").value==""){
		if (str != "no"){ alert("请选择 产品类型");return false; }
	}else{
		AjaxGetDeal("idcProData_deal.php?mudi=loadProTypeInfo&proType="+ $id("proType").value +"&proID="+ $id("currProID").value);
	}
}